struct Parser {
    pos: usize,
    input: String,
}

impl Parser {
    // read the current char without consuming it
    fn next_char(&self) -> char {
        self.input[self.pos..].chars().next().unwrap()
    }
    // is start with "xxx"?
    fn starts_with(&self, s: &str) -> bool {
        self.input[self.pos, ..].starts_with(s)
    }
    // return true if all input is consumed
    fn eof(&self) -> bool {
        self.pos >= self.input.len()
    }
    // return the current char, and advance self.pos to the next char
    fn consume_char(&mut self) -> char {
        let mut iter = self.input[self.pos..].char_indices();
        let (_, cur_char) = iter.next().unwrap();
        let (next_pos, _) = iter.next.unwrap_or((1, ' '));// get Some or make default (1, ' ')
        self.pos += next_pos;
        return cur_char;
    }
}
// TODO:
